
package cartoon.room.read.room;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

import java.util.List;

import cartoon.room.CartoonHistoryModel;


public class CartoonReadHistoryViewModel extends AndroidViewModel {
    private CartoonReadRxJava rxJavaThread;


    public CartoonReadHistoryViewModel(@NonNull Application application) {
        super(application);


        rxJavaThread = CartoonReadRxJava.getInstance(getApplication());
    }

    public void addHistoryDao(cartoon.room.read.room.CartoonReadHistoryModel historyModel) {
        rxJavaThread.addHistoryDao(historyModel);
    }

    public void addsHistoryDao(cartoon.room.read.room.CartoonReadHistoryModel... historyModels) {
        rxJavaThread.addsHistoryDao(historyModels);
    }


    public void deleteHistory(cartoon.room.read.room.CartoonReadHistoryModel... historyModels) {
        rxJavaThread.deleteHistory(historyModels);
    }

    public void updateHistory(cartoon.room.read.room.CartoonReadHistoryModel... historyModels) {
        rxJavaThread.updateHistory(historyModels);
    }


//    public HistoryModel getHistoryId(Integer id) {
////        return historyDao.getHistoryId(id);
//        return rxJavaThread.getHistoryId(id);
//    }

    public void deleteTableData() {
        rxJavaThread.deleteTableData();

    }

    public LiveData<List<CartoonReadHistoryModel>> getAllSLive() {
        return rxJavaThread.getAllSLive();
    }
}
